package ntu.sce.fyp.easilocation.datastore.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.GeoPt;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Location {
	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY) public Key id;
	@Persistent private User username;
	@Persistent private GeoPt geopoint;
	@Persistent private long timestamp;
	@Persistent private float accuracy;
	@Persistent private String provider;
	
	public Location(User username, GeoPt geopoint, long timestamp, 
					float accuracy, String provider) {
		this.username = username;
		this.geopoint = geopoint;
		this.timestamp = timestamp;
		this.accuracy = accuracy;
		this.provider = provider;
	}

	public User getUsername() {
		return username;
	}

	public void setUsername(User username) {
		this.username = username;
	}

	public GeoPt getGeopoint() {
		return geopoint;
	}

	public void setGeopoint(GeoPt geopoint) {
		this.geopoint = geopoint;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public float getAccuracy() {
		return accuracy;
	}

	public void setAccuracy(float accuracy) {
		this.accuracy = accuracy;
	}

	public String getProvider() {
		return provider;
	}

	public void setProvider(String provider) {
		this.provider = provider;
	}
}
